from re_common.baselibrary.utils.basefile import BaseFile

filepath = r'E:\ZL\WFPatent.idx'

new_filepath = r''




def read_file(filepath,new_filepath):
    count = 1
    te = BaseFile.read_file_rb_mode_yield(filepath)
    print(BaseFile.get_file_size(filepath))
    for line in te:
        line = BaseFile.bytes_takeout_utf8bom(line) + '\n'
        BaseFile.add_file_ab_mode(line,new_filepath)
        count += 1
        print(count)
        if count == 101:
            break


if __name__ == '__main__':
    read_file(filepath,new_filepath)